home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / kchatdialog.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  3.0 KB  |  120 lines

  1. /*
  2.     This file is part of the KDE games library
  3.     Copyright (C) 2001 Andreas Beckermann (b_mann@gmx.de)
  4.  
  5.     This library is free software; you can redistribute it and/or
  6.     modify it under the terms of the GNU Library General Public
  7.     License version 2 as published by the Free Software Foundation.
  8.  
  9.     This library is distributed in the hope that it will be useful,
  10.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12.     Library General Public License for more details.
  13.  
  14.     You should have received a copy of the GNU Library General Public License
  15.     along with this library; see the file COPYING.LIB.  If not, write to
  16.     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  17.     Boston, MA 02110-1301, USA.
  18. */
  19.  
  20. #ifndef __KCHATDIALOG_H__
  21. #define __KCHATDIALOG_H__
  22.  
  23. #include <kdialogbase.h>
  24. #include <kdemacros.h>
  25.  
  26. class KChatBase;
  27.  
  28. class KChatDialogPrivate;
  29.  
  30. class KDE_EXPORT KChatDialog : public KDialogBase
  31. {
  32.     Q_OBJECT
  33. public:
  34.     /**
  35.      * Construct a KChatDialog widget
  36.      **/
  37.     KChatDialog(QWidget* parent, bool modal = false);
  38.  
  39.     /**
  40.      * Construct a KChatDialog widget which automatically configures the
  41.      * @ref KChatBase widget. You probably want to use this as you don't
  42.      * have to care about the configuration stuff yourself.
  43.      **/
  44.     KChatDialog(KChatBase* chatWidget, QWidget* parent, bool modal = false);
  45.  
  46.     /**
  47.      * Destruct the dialog
  48.      **/
  49.     ~KChatDialog();
  50.  
  51.     /**
  52.      * @return The font that shall be used as the "name: " part of a normal
  53.      * message.
  54.      **/
  55.     QFont nameFont() const;
  56.  
  57.     /**
  58.      * @return The font that shall be used for normal messages.
  59.      **/
  60.     QFont textFont() const;
  61.     
  62.     /**
  63.      * @return The font that shall be used as the "name: " part of a system
  64.      * (game) message.
  65.      **/
  66.     QFont systemNameFont() const;
  67.     
  68.     /**
  69.      * @return The font that shall be used for a system (game) message.
  70.      **/
  71.     QFont systemTextFont() const;
  72.  
  73.     /**
  74.      * Set the widget that will be configured by the dialog. Use this if you
  75.      * don't want to configure the widget yourself.
  76.      * @param widget The chat widget that shall be configured
  77.      * @param Whether you want to have the current @ref KChatBase fonts as
  78.      * defaults in the dialog
  79.      **/
  80.     void plugChatWidget(KChatBase* widget, bool applyFonts = true);
  81.  
  82.     /**
  83.      * Used to configure the chat widget according to the user settings.
  84.      * This is called automatically if @ref plugChatWidget was called
  85.      * before.
  86.      * @param widget The chat widget that shall be configured
  87.      **/
  88.     void configureChatWidget(KChatBase* widget);
  89.  
  90.     /**
  91.      * @return The maximal allowed messages in the chat widget. -1 is
  92.      * unlimited
  93.      **/
  94.     int maxMessages() const;
  95.  
  96. protected slots:
  97.     void slotGetNameFont();
  98.     void slotGetTextFont();
  99.     void slotGetSystemNameFont();
  100.     void slotGetSystemTextFont();
  101.  
  102.     virtual void slotApply();
  103.     virtual void slotOk();
  104.  
  105. private:
  106.     void setNameFont(QFont);
  107.     void setTextFont(QFont);
  108.     void setSystemNameFont(QFont);
  109.     void setSystemTextFont(QFont);
  110.     void setMaxMessages(int max);
  111.  
  112. private:
  113.     void init();
  114.  
  115. private:
  116.     KChatDialogPrivate* d;
  117. };
  118.  
  119. #endif
  120.